import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'firStr'
})
export class FirStrPipe implements PipeTransform {

  transform(value: any, args?: any): any {

  	args = args?args:5;

  	if(value) {
  		if(value.split('').length>5) {
  			return value.substr(0,args)+'...';
  		}else {
  			return value;
  		}
  	}

  }

}

@Pipe({
  name: 'firStrT'
})
export class FirStrTPipe implements PipeTransform {

  transform(value: any, args?: any): any {

    args = args?args:5;

    if(value) {
      if(value.split('').length>5) {
        let result = value.substr(0,args).replace('/','')
        return result;
      }else {
        return value;
      }
    }

  }

}
